<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <!-- 引入animate.css -->
  <link
    rel="stylesheet"
    href="https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.min.css"
  />
  <style>
    .div1 {
      width: 100px;
      height: 100px;
      background-color: hotpink;
    }
  </style>
</head>
<body>
  <div id="app">
    <button @click="isShow = !isShow">toggle</button>
    <!-- enter-active-class进入的效果 -->
    <!-- leave-active-class离开的效果 -->
    <!-- 记得写animate__前缀，而且是两个下划线__ -->
    <transition 
      enter-active-class="animate__animated animate__bounce"
      leave-active-class="animate__animated animate__flash"
    >
      <div class="div1" v-show="isShow"></div>
    </transition>
  </div>
  <script src="../vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        isShow: true
      }
    })
  </script>
</body>
</html>